import 'package:flutter/material.dart';

class Currency extends StatelessWidget {
  final List<Map<String, String>> countryList = [
    {'country': '澳大利亚', 'currency': 'AUD'},
    {'country': '阿根廷', 'currency': 'ARS'},
    {'country': '比利时', 'currency': 'EURO'},
    {'country': '巴西', 'currency': 'REAL'},
    {'country': '加拿大', 'currency': 'CAD'},
    {'country': '法国', 'currency': 'EURO'},
    {'country': '香港', 'currency': 'HKD'},
    {'country': '意大利', 'currency': 'EURO'},
    {'country': '中国', 'currency': 'RMB'},
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            children: setListTile(),
          ),
        ),
      ),
    );
  }

  List<Widget> setListTile() {
    List<Widget> list = new List();
    list.add(ListTile(title: Text('货币', style: TextStyle(fontSize: 30))));
    for (var countryMap in this.countryList) {
      list.add(ListTile(
          title: Text(countryMap['country']),
          trailing: Text(countryMap['currency'])));
      list.add(Divider());
    }
    return list;
  }
}
